1. Field of the Invention
The invention relates to a motion vector estimation system and method thereof, and more particularly to a system and method thereof capable of reducing memory bandwidth and accurately estimating motion vector.
2. Description of the Prior Art
The motion vector estimation system is a most important part in the conventional video encoder. The motion vector estimation system requires not only a great deal of calculation but lots of memory bandwidth while pixel data is being read.
Referring to FIG. 1, FIG. 1 is a functional block diagram illustrating the conventional video encoder 10. The video encoder 10 includes a hardware accelerator 12 for estimating and calculating the motion and a central processing unit (CPU) 14 for dealing with other workload. To reduce the loading of the main bus 16, a buffer 18, namely search window, is used for caching pixel data from the main memory 20. Afterward, the hardware accelerator 12 retrieves the pixel data from the buffer 18 for subsequent operation. For a motion estimator with a search range of [−r, r−1], the included number of pixels is (2r+b)2, wherein a macroblock consists of b*b pixels. For example, if the search range is [−32, 31] and the macroblock consists of 16*16 pixels, the motion estimator has to load a search window including 80*80 pixels; if the search range is reduced from [−32, 31] to [−16, 15], the search window only includes 48*48 pixels correspondingly. However, though a smaller search range is helpful to decrease complicated calculation and lower the required memory bandwidth, a larger search range is still necessary for some applications, such as high definition television (HDTV), so as to improve the image quality and the bit rate.
To improve the motion estimation, U.S. Pat. No. 6,078,618 (hereinafter '618 patent) has disclosed a system for estimating the offset of search window to expand the search range without enlarging the search window. However, the search window disclosed in '618 patent is irregular while it is being loaded, so that it will bring the bandwidth lots of loading.
Referring to FIGS. 2A through 2C, FIG. 2A is a schematic diagram illustrating the search window 22 corresponding to the macroblock n. FIG. 2B is a schematic diagram illustrating the search window 24 without offset corresponding to the macroblock m. FIG. 2C is a schematic diagram illustrating the search window 26 with horizontal offset 4b corresponding to the macroblock m. As shown in FIG. 2A, if the search window is set as [−b, b−1], the search window 22 corresponding to the macroblock n includes 9b2 pixels (i.e. the slash area), wherein b is equal to the size of macroblock. As shown in FIG. 2B, if the search window 24 corresponding to the macroblock m has no offset, that is to say the macroblock m is at the center of the search window 24, 6b2 pixels (as the slash area with dotted line), which the search windows 24 and 26 overlap, have been loaded in, and then the motion estimator only needs to load in the remained 3b2 pixels (as the slash area with real line). However, if the search window is variable, the architecture shown in FIG. 2B will be failure. As shown in FIG. 2C, the search window 26 corresponding to the macroblock m has a horizontal offset 4b, and the search windows 24 and 26 does not overlap. In another word, the motion estimator cannot reuse the pixel data of search window 22 stored previously, and 9b2 pixels of the search window 26 have to be loaded in again. In the aforementioned prior art, if the search window can be shifted by a variable offset, the reloaded data will bring the bandwidth lots of loading.
Therefore, the scope of the invention is to provide a motion vector estimation system and method thereof to solve the aforementioned problems.